<template>
  <div class="container" @click="handleGallaryClick">
    <div class="wrapper">
      <swiper :options="swiperOption">
    <!-- slides -->
    <swiper-slide v-for="(item, index) of gallaryImgs" :key="index"><img class="swiper-img" :src="item"/></swiper-slide>
    <!-- Optional controls  -->
    <div class="swiper-pagination" slot="pagination"></div>
  </swiper>
    </div>
  </div>
</template>

<script>
export default {
  name: 'commonGallary',
  props: {
    gallaryImgs: Array
  },
  methods: {
    handleGallaryClick () {
      this.$emit('close')
    }
  },
  data () {
    return {
      swiperOption: {
        // loop: true,
        pagination: '.swiper-pagination',
        paginationType: 'fraction'
      }
    }
  }
}
</script>

<style lang="stylus" scoped>
.container
  z-index 99
  position fixed
  flex-direction column
  justify-content center
  left 0
  right 0
  top 0
  bottom 0
  background #222
  .wrapper
    margin-top 2.6rem
    width 100%
    height 0
    padding-bottom 100%
    overflow hidden
    .swiper-pagination
      color #fff
    .swiper-img
      width 100%
</style>
